<?php 
 //file_put_contents("/home/www/a.tttj.3z.cc/cache/set.txt",$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\r\n",FILE_APPEND);
//signcheck(array($appid,$pt,$imei,$uid));
$op = $_GET['op'];
if($op == 'add'){
    $sql = "insert into tttj.set_status (status,uid,appid) values (1,$uid,$appid)";
    exec_db($sql);
    echojson('添加成功','1','');exit;
}

if($op == 'del'){
    $sql = "delete from tttj.set_status where uid = $uid";
    exec_db($sql);
    echojson('删除成功','1','');exit;
}
$tstatus = (int)$_GET['tstatus'];

$sql = "select * from tttj.set_status where uid = $uid and appid = $appid";
$re = getonerecord($sql);
if($re){
    $tstatus = '1';
}else{
    $tstatus = '0';
}
$tpl->assign('tstatus',$tstatus);

$appcolor = getappcolor($appid);
$tpl->assign("appcolor",$appcolor);

if(version_compare($ver,'3.1.2','>=')){
    $test_id = '1';
}
$tpl->assign('test_id',$test_id);

$tpl->display("{$tp}.html");
?>